package com.jack.lease.web.app.controller;

import com.jack.lease.common.result.Result;
import com.jack.lease.web.app.service.FileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;


@Slf4j
@Tag(name = "文件管理")
@RequestMapping("/admin/file")
@RestController
public class FileUploadController {

    @Resource
    private FileService fileService;


    @GetMapping("/getImage/{id}/{fileName}")
    public ResponseEntity<Object> getImage(@PathVariable("id") Long id,
                                           @PathVariable("fileName") String fileName) {

        return fileService.getImage(id, fileName);
    }

}
